import request from '@/utils/request'
import { Result, DeepRequired } from '../../interface'

/**
 * 使用默认路径上传
 * /file/upload
 */
export function postFileUpload(params: PostFileUploadParams) {
  const paramsInput = {
    file: params.file,
  }
  return request.post<DeepRequired<Result>>(`/file/upload`, null, {
    params: paramsInput,
  })
}

interface PostFileUploadParams {
  file: File
}
